/*
	Pinkie's Balloon Fight
	Copyright (C) 2012  dancinninja (dancinninjac@gmail.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __Pinkie_LiveObject_Class__
#define __Pinkie_LiveObject_Class__

#include "StdInc.h"
#include "Object.h"

const float GRAVITY_ACCELERATION = 2.0f / 10000.0f;

const f32 HORIZONTAL_DIR_ACCEL = 0.08f;
const f32 VIRTICAL_JUMP_ACCEL = 0.15f;

// Can't go faster than this:
static const f32 TERMINAL_VELOCITY = 2.0f / 10.0f;

// When we're bouncing off things, how much our momentum is decreased:
const f32 HIT_Y_DECEL = 4;
const f32 HIT_X_DECEL = 2;

const f32 HIT_TEST_THRESHOLD = 10.0f;

// -1: left | 0: still | 1: right
enum DIRECTION{
	LEFT = -1,
	NONE = 0,
	RIGHT = 1,
};

class Object;
class Platform;

// ------ CLASS for players/enemies -----------
class LiveObject: public Object{

public:

	LiveObject();
	~LiveObject();

	void Render();
	void Update();
	void ChangeDirection(DIRECTION dir);
	void Jump();
	bool CollideWithPlatform(Platform& platform);

	void GetHit();
	bool IsAlive() const;
	void Die();

	bool IsReadyToJump() const;
	void SetReadyToJump();
//private:

	f32 xAccel;
	f32 yAccel;

	int lives; // Or "balloons"

	// -1: left | 0: still | 1: right
	DIRECTION horizontalDirection; 

	bool alive;
	bool readyToJump;

	//Inherits from Object:
	/*
	f32 x;
	f32 y;

	// For collision detection
	f32 width;
	f32 height;

	// Texture
	Texture* texture;
	*/

};

#endif